🎖️GitЯра🎖️
Node / meshtastic / Meshtastic-Android / files / androidApp / src / main / kotlin / org / meshtastic / app / map / SitePlannerRequestState.kt
Displaying Raw • Download
androidApp/src/main/kotlin/org/meshtastic/app/map/SitePlannerRequestState.kt 35e2abbe2626ee13222253022972bd7d90adf0d3 (35e2abbe) Text, 2.44 KB
T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.app.map
Tff7b72import T7ee787kotlinx.coroutines.flow.Flow
Tff7b72import T7ee787kotlinx.coroutines.flow.MutableStateFlow
Tff7b72import T7ee787kotlinx.coroutines.flow.StateFlow
Tff7b72import T7ee787kotlinx.coroutines.flow.combine
Tff7b72import T7ee787kotlinx.coroutines.flow.update
Tff7b72import T7ee787org.meshtastic.core.model.Node
T8b949e/** Resolves a one-shot Site Planner route request against the live node database. */
Tff7b72internal Tff7b72class T56d364SitePlannerRequestStateTb4b4b4(Te6edf3nodesByNumTb4b4b4: Te6edf3StateFlowTff7b72<Te6edf3MapTff7b72<Tffa657IntTb4b4b4, Te6edf3NodeTff7b72>Tff7b72>Tb4b4b4) Tb4b4b4{
Tff7b72private Tff7b72val Te6edf3routeRequest Tff7b72= Te6edf3MutableStateFlowTff7b72<Te6edf3SitePlannerRouteRequestTff7b72>Tb4b4b4(Te6edf3SitePlannerRouteRequestTb4b4b4.Te6edf3NoneTb4b4b4)
Tff7b72val Te6edf3requestTb4b4b4: Te6edf3FlowTff7b72<Te6edf3Node?Tff7b72> Tff7b72=
Te6edf3combineTb4b4b4(Te6edf3routeRequestTb4b4b4, Te6edf3nodesByNumTb4b4b4) Tb4b4b4{ Te6edf3requestTb4b4b4, Te6edf3nodes Tff7b72-Tff7b72>
Tb4b4b4(Te6edf3request Tff7b72as? Te6edf3SitePlannerRouteRequestTb4b4b4.Te6edf3PendingTb4b4b4)Tff7b72?.Te6edf3nodeNumTff7b72?.Te6edf3let Tb4b4b4{ Te6edf3nodesTff7b72[Tffa657itTff7b72] Tb4b4b4}
Tb4b4b4}
Tff7b72fun Td2a8ffsetNodeNumTb4b4b4(Te6edf3nodeNumTb4b4b4: Tffa657Int?Tb4b4b4) Tb4b4b4{
Te6edf3routeRequestTb4b4b4.Te6edf3update Tb4b4b4{ Te6edf3current Tff7b72-Tff7b72>
Tff7b72when Tb4b4b4{
Te6edf3nodeNum Tff7b72=Tff7b72= Tff7b72null Tff7b72-Tff7b72> Te6edf3SitePlannerRouteRequestTb4b4b4.Te6edf3None
Te6edf3current Tff7b72is Te6edf3SitePlannerRouteRequestTb4b4b4.Te6edf3Consumed Tff7b72&Tff7b72& Te6edf3currentTb4b4b4.Te6edf3nodeNum Tff7b72=Tff7b72= Te6edf3nodeNum Tff7b72-Tff7b72> Te6edf3current
Tff7b72else Tff7b72-Tff7b72> Te6edf3SitePlannerRouteRequestTb4b4b4.Te6edf3PendingTb4b4b4(Te6edf3nodeNumTb4b4b4)
Tb4b4b4}
Tb4b4b4}
Tb4b4b4}
Tff7b72fun Td2a8ffconsumeTb4b4b4(Te6edf3nodeNumTb4b4b4: Tffa657IntTb4b4b4) Tb4b4b4{
Te6edf3routeRequestTb4b4b4.Te6edf3update Tb4b4b4{ Te6edf3current Tff7b72-Tff7b72>
Tff7b72if Tb4b4b4(Te6edf3current Tff7b72is Te6edf3SitePlannerRouteRequestTb4b4b4.Te6edf3Pending Tff7b72&Tff7b72& Te6edf3currentTb4b4b4.Te6edf3nodeNum Tff7b72=Tff7b72= Te6edf3nodeNumTb4b4b4) Tb4b4b4{
Te6edf3SitePlannerRouteRequestTb4b4b4.Te6edf3ConsumedTb4b4b4(Te6edf3nodeNumTb4b4b4)
Tb4b4b4} Tff7b72else Tb4b4b4{
Te6edf3current
Tb4b4b4}
Tb4b4b4}
Tb4b4b4}
Tb4b4b4}
T8b949e/** Retained in the entry-scoped ViewModel so returning to its composition cannot re-arm a consumed route argument. */
Tff7b72private Tff7b72sealed Tff7b72interface T56d364SitePlannerRouteRequest Tb4b4b4{
Tff7b72data Tff7b72object T56d364None Tb4b4b4: Te6edf3SitePlannerRouteRequest
Tff7b72data Tff7b72class T56d364PendingTb4b4b4(Tff7b72val Te6edf3nodeNumTb4b4b4: Tffa657IntTb4b4b4) Tb4b4b4: Te6edf3SitePlannerRouteRequest
Tff7b72data Tff7b72class T56d364ConsumedTb4b4b4(Tff7b72val Te6edf3nodeNumTb4b4b4: Tffa657IntTb4b4b4) Tb4b4b4: Te6edf3SitePlannerRouteRequest
Tb4b4b4}
Served by rngit 1.5.0 - Generated in 0.04s